package org.darkforest.common.services.impl;

import org.darkforest.common.services.StoreExtendsService;
import org.darkforest.dao.mapper.StoreExtendMapper;
import org.darkforest.model.StoreExtend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Administrator on 2015/12/4.
 */
@Service
public class StoreExtendsServiceImpl implements StoreExtendsService {

    @Autowired
    private StoreExtendMapper storeExtendMapper;


    @Override
    public int deleteByPrimaryKey(Integer storeId) {
        return storeExtendMapper.deleteByPrimaryKey(storeId);
    }

    @Override
    public int insert(StoreExtend record) {
        return storeExtendMapper.insert(record);
    }

    @Override
    public int insertSelective(StoreExtend record) {
        return storeExtendMapper.insertSelective(record);
    }

    @Override
    public StoreExtend selectByPrimaryKey(Integer storeId) {
        StoreExtend storeExtend=storeExtendMapper.selectByPrimaryKey(storeId);
        if(storeExtend == null){
             storeExtend = storeExtendMapper.findFirstRecord();
        }
        return storeExtend;
    }

    @Override
    public int updateByPrimaryKeySelective(StoreExtend record) {
        return storeExtendMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKeyWithBLOBs(StoreExtend record) {
        return storeExtendMapper.updateByPrimaryKeyWithBLOBs(record);
    }
}
